package ${cfg.package_name}.dtomapper;

import ${cfg.package_name}.bean.${entity};
import ${cfg.package_name}.dto.${entity}Dto;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;
import java.util.List;

/**
 * dto bean 映射类
 * @author ${author}
 * @since ${date}
 */
@Mapper(componentModel = "spring")
public interface ${entity}DtoMapper {
    @Named("bean2dto1")
    ${entity}Dto bean2dto(${entity} bean);

    @Named("dto2bean1")
    ${entity} dto2bean(${entity}Dto dto);

    @IterableMapping(qualifiedByName = "bean2dto1")
    List<${entity}Dto> bean2dtoList(List<${entity}> beans);

    @IterableMapping(qualifiedByName = "dto2bean1")
    List<${entity}> dto2beanList(List<${entity}Dto> dtos);
}